package com.demo.travel.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.demo.travel.R;
import com.demo.travel.base.BaseActivity;
import com.demo.travel.bean.ItemBean;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Create author 振华OPPO
 * Create time 2021/6/18 11:11
 */
public class NewsDetailActivity extends BaseActivity {

    @BindView(R.id.title1Tv)
    TextView title1Tv;

    @BindView(R.id.zhaiyaoTv)
    TextView zhaiyaoTv;

    @BindView(R.id.contentTv)
    TextView contentTv;

    @BindView(R.id.backIv)
    ImageView backIv;

    private ItemBean itemBean;

    @Override
    protected int initLayout() {
        return R.layout.activity_news_detail;
    }

    @Override
    protected void initView() {
        backIv.setVisibility(View.VISIBLE);
        itemBean=(ItemBean) getIntent().getSerializableExtra("itemBean");
        title1Tv.setText(itemBean.getTitle());
        zhaiyaoTv.setText("\t\t\t\t\t\t\t"+itemBean.getContent().substring(0,30)+"...");
        contentTv.setText(itemBean.getContent());
    }

    @Override
    protected void initData() {

    }

    @Override
    public String getActivityTitle() {
        return "热点新闻";
    }

    @OnClick({R.id.collectTv,R.id.backIv})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.collectTv:
                showToast("收藏成功！");
                break;
            case R.id.backIv:
                finish();
                break;
        }
    }

}
